package com.gitee.wsl.common.ui.symbol

import androidx.compose.ui.graphics.Path
import com.gitee.wsl.common.ui.base.Point
import com.gitee.wsl.common.ui.ext.path.lineTo
import com.gitee.wsl.common.ui.ext.path.moveTo
import com.gitee.wsl.mathematics.geometry.shape.Line

fun Symbol.line(startPoint: Point = Point(), endPoint: Point = Point()) = Line(startPoint,endPoint)

/**
 * Computes the unit vector representing a line between the two points [p1] and [p2].
 */
//internal fun line(p1: Point, p2: Point): Point = (p2 - p1) / (p2 - p1).mag()

fun Path.line(line: Line){
    this.moveTo(line.startPoint)
    this.lineTo(line.endPoint)
}

